<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" scope="page"/>
<!DOCTYPE html>
<html>
<head>
    <title>Insert title here</title>
    <link rel="stylesheet" href="${ctx}/css/templatemo_style.css"/> <!-- 页面整体布局样式定义 -->
    <link rel="stylesheet" href="${ctx}/css/ddsmoothmenu.css"/> <!-- 菜单样式定义 -->

    <script type="text/javascript" src="${ctx}/js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript">
        var ctx = "${pageContext.request.contextPath}";

        function showUserName() {
            var name = "${user.username}";
            if (name != "") {
                $("#login").html(name);
                $("#exitP").show();
                $("#login").attr("href", ctx + "/user?flag=info&userId=${user.userid}");
            } else {
                $("#login").html("登录");
                $("#exitP").hide();
                $("#login").attr("href", ctx + "/user?flag=login");
            }
        }


    </script>
</head>

<body>
<div id="templatemo_body_wrapper">
    <div id="templatemo_wrapper">


        <!-- header -->
        <div id="templatemo_header">
            <div id="site_title"><h1><a href="">穿美在线鞋城</a></h1></div>
            <div id="header_right">
                <p>
                    <a href="" id="login">登录</a>&nbsp;
                    <span id="exitP" style="display: none"><a href="" id="exit">注销</a></span>
                </p>
            </div>
            <div class="cleaner"></div>
        </div>
        <!-- END of templatemo_header -->


        <!-- menu -->
        <div id="templatemo_menubar">
            <div id="top_nav" class="ddsmoothmenu">
                <ul>
                    <li><a href="${ctx}/home" >首页</a></li>
                    <li><a href="${ctx}/pro?flag=product" class="selected">产品</a></li>
                    <li><a href="${ctx}/ShoppingCartServlet">我的购物车</a></li>
                    <li><a href="${ctx}/OrderServlet?flag=qoi">我的订单</a></li>
                </ul>
                <br style="clear: left"/>
            </div>
            <!-- end of ddsmoothmenu -->
        </div>
        <!-- END of templatemo_menubar -->


        <!-- main -->
        <div id="templatemo_main">
            <!-- 侧边栏 -->
            <div id="sidebar" class="float_l">
                <!-- sidebar 1 -->
                <div class="sidebar_box">
                    <span class="bottom"></span>
                    <h3>品牌</h3>
                    <c:forEach items="${brand}" var="bra">
                        <div class="content">
                            <ul class="sidebar_list">
                                <li><a href="pro?flag=brand&&category_id=${bra.category_id}"><c:out
                                        value="${bra.name}"/></a></li>
                            </ul>
                        </div>
                    </c:forEach>
                </div>
                <!-- sidebar 2 -->
                <div class="sidebar_box">
                    <span class="bottom"></span>
                    <h3>热卖单品</h3>
                    <c:forEach items="${hot}" var="hot">
                        <div class="content">
                            <div class="bs_box">
                                <a
                                        href="${ctx}/pro?flag=detailed&&product_id=${hot.product_id}"><img
                                        src="${ctx}/${hot.imgpath}" alt="image"
                                        style="width: 96px; height: 96px" /></a>
                                <h4>
                                    <br /> <a
                                        href="${ctx}/pro?flag=detailed&&product_id=${hot.product_id}">${hot.feature}</a>
                                </h4>
                                <br />
                                <p class="price">${hot.price}.00￥</p>
                                <div class="cleaner"></div>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
            <div id="content" class="float_r">
                <c:forEach items="${prolist}" var="list">
                    <div class="product_box">
                        <a href="${ctx}/pro?flag=detailed&product_id=${list.product_id}"><img
                            src="${ctx}/${list.imgpath}" alt="Shoes 2" style="width: 200px"/></a>
                        <p>${list.feature}</p>
                        <p class="product_price">${list.price}.00￥</p>
                        <!--这是id~${list.product_id}-->
                        <a href="${ctx}/ShoppingCartServlet?flag=insert&product_id=${list.product_id}"
                           class="addtocart"></a>
                        <a href="${ctx}/pro?flag=detailed&product_id=${list.product_id}" class="detail"></a>
                        <input type="hidden" name="flag" value="ls"/>
                    </div>
                </c:forEach>
            </div>

            <div class="product_box_fy">
                <a href="#">${currentPage} / ${totalPages} 页</a>
                <a href="${ctx}/pro?flag=${fen}&category_id=${category_id}&pageMethod=first&currentPage=${currentPage}">首页</a>
                <a href="${ctx}/pro?flag=${fen}&category_id=${category_id}&pageMethod=previous&currentPage=${currentPage}">上一页</a>
                <a href="${ctx}/pro?flag=${fen}&category_id=${category_id}&pageMethod=next&currentPage=${currentPage}">下一页</a>
                <a href="${ctx}/pro?flag=${fen}&category_id=${category_id}&pageMethod=last&currentPage=${currentPage}">尾页</a>
            </div>

            <div class="cleaner"></div>
        </div>
        <!-- END of templatemo_main -->


        <!-- footer -->
        <div id="templatemo_footer">
            <p>
                <a href="${ctx}/pro">首页</a>&nbsp;&nbsp;&nbsp;
                <a href="${ctx}/pro?flag=product">产品</a>&nbsp;&nbsp;&nbsp;
                <a href="${ctx}/ShoppingCartServlet">我的购物车</a>&nbsp;&nbsp;&nbsp;
                <a href="${ctx}/OrderServlet?flag=qoi">我的订单</a>
            </p>
            版权所有 (c) 2018 <a href="javascript:void(0);">金桥软件</a>
        </div>
        <!-- END of templatemo_footer -->


    </div>
    <!-- END of templatemo_wrapper -->
</div>
<!-- END of templatemo_body_wrapper -->

<script type="text/javascript">
    $(function () {
        showUserName();

        $("#ps").change(function () {
            var ps = $(this).val();
            $("#pageSize").val(ps);
            $("#pageNo").val(1);
            $("#profy").submit();
        });
    });
</script>
<script type="text/javascript" src="${ctx}/js/stock-check.js"></script> <!-- 添加购物车JS脚本定义 -->
</body>
</html>







